# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-pyliblzma
pkgver=0.5.3
pkgrel=2
pkgdesc='Python 2 bindings for liblzma.'
arch=('x86_64' 'aarch64')
url='https://pypi.python.org/pypi/pyliblzma'
license=('LGPL3')
depends=('python2' 'xz')
makedepends=('python2-setuptools')
source=("https://pypi.python.org/packages/source/p/pyliblzma/pyliblzma-$pkgver.tar.bz2")
sha512sums=('272983aac426e86d6d636ccba4fe78a07d7282560081df937114162bfd317bd8023814693b8d473d0f7884e38a968ebeaf8f954a5a27c1f7e5da084f3fd05c65')

prepare() {
  cd "pyliblzma-$pkgver"

  sed -e 's/env python$/env python2/g' -i liblzma.py
}

build() {
  cd "pyliblzma-$pkgver"

  python2 setup.py build
}

package() {
  cd "pyliblzma-$pkgver"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

